package com.lingshu.app.ui.home;

import android.os.Bundle;

import androidx.lifecycle.ViewModelProvider;

import com.lingshu.app.R;
import com.lingshu.app.base.BaseFragment;
import com.lingshu.app.databinding.FragmentHomeBinding;

/**
 * @author 于定金
 * @version 1.0
 * @Date 2024/1/3 14:15
 * @Description
 */
public class HomeFragment extends BaseFragment<FragmentHomeBinding, HomeFragmentViewModel> {
    /**
     * 传递参数
     *
     * @param param1
     * @param param2
     * @return
     */
    public static HomeFragment newInstance(String param1, String param2) {
        HomeFragment fragment = new HomeFragment();
        Bundle args = new Bundle();
        fragment.setArguments(args);
        return fragment;
    }

    /**
     * 获取当前页面的布局资源ID
     *
     * @return 布局资源ID
     */
    @Override
    protected int getLayoutResId() {
        return R.layout.fragment_home;
    }

    /**
     * 初始化ViewModel
     */
    @Override
    protected void initViewModel() {
        viewModel = new ViewModelProvider(this).get(HomeFragmentViewModel.class);
    }

    /**
     * 绑定ViewModel
     */
    @Override
    protected void bindViewModel() {
        dataBinding.setViewModel(viewModel);
    }

    /**
     * 初始化
     */
    @Override
    protected void init() {

    }
}